package com.jiangyao.model.dto.backend;

import com.jiangyao.model.dto.BaseDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 后台管理账号DTO
 *
 * @author: yangyongchuan
 * @create: 2020年08月12日 00:29
 */
@Data
@ApiModel(value = "后台管理账号DTO")
public class AdminUserDTO implements BaseDTO {
	public interface Login {
	}

	private static final long serialVersionUID = -6519717383351365201L;

	/**
	 * 后台用户ID
	 */
	@ApiModelProperty(value = "后台用户ID")
	@NotNull(message = "账号不能为空", groups = {Edit.class})
	private Integer adminId;

	/**
	 * 账号
	 */
	@ApiModelProperty(value = "账号", example = "admin")
	@NotNull(message = "账号不能为空", groups = {Login.class})
	@NotEmpty(message = "账号不能为空", groups = {Login.class})
	private String loginName;

	/**
	 * 密码
	 */
	@ApiModelProperty(name = "密码", example = "123456")
	@NotNull(message = "密码不能为空", groups = {Login.class})
	@NotEmpty(message = "密码不能为空", groups = {Login.class})
	@Length(min = 6, max = 50, message = "密码长度不正确", groups = {Login.class})
	private String password;

	/**
	 * 手机号
	 */
	@ApiModelProperty(value = "手机号", example = "13800000000")
	@Length(min = 11, max = 11, message = "手机号不正确", groups = {Add.class, Edit.class})
	private String phone;

	/**
	 * 姓名
	 */
	@ApiModelProperty(value = "姓名", example = "管理员")
	@NotNull(message = "姓名不能为空", groups = {Add.class, Edit.class})
	@NotEmpty(message = "姓名不能为空", groups = {Add.class, Edit.class})
	private String adminName;

	/**
	 * 头像
	 */
	@ApiModelProperty(value = "头像",example = "/img/user_head_default.png")
	private String adminPhoto;

	/**
	 * 简介
	 */
	@ApiModelProperty(value = "简介",example = "  ")
	private String adminDesc;

	/**
	 * 状态 1启用 0 关闭
	 */
	@ApiModelProperty(value = "状态 1启用 0 关闭",example = "1")
	@NotNull(message = "状态 1启用 0 关闭", groups = {Edit.class})
	private Integer status = 1;

	/**
	 * 角色ID集合
	 */
	@ApiModelProperty(value = "角色ID集合")
	List<Integer> roleIdList;

}
